<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>trunk.BIP.Bayes.like</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="trunk.BIP-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bayesian-inference">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;trunk ::
        <a href="trunk.BIP-module.html">Package&nbsp;BIP</a> ::
        <a href="trunk.BIP.Bayes-module.html">Package&nbsp;Bayes</a> ::
        Module&nbsp;like
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module like</h1><p class="nomargin-top"><span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html">source&nbsp;code</a></span></p>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="trunk.BIP.Bayes.like-module.html#Categor" class="summary-sig-name">Categor</a>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">hist</span>)</span><br />
      Categorical Log-likelihood
generalization of a Bernoulli process for variables with any constant
number of discrete values.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Categor">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="trunk.BIP.Bayes.like-module.html#Uniform" class="summary-sig-name">Uniform</a>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">min</span>,
        <span class="summary-sig-arg">max</span>)</span><br />
      Uniform Log-likelihood</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Uniform">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="trunk.BIP.Bayes.like-module.html#Normal" class="summary-sig-name">Normal</a>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">mu</span>,
        <span class="summary-sig-arg">tau</span>)</span><br />
      Normal Log-like</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Normal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="find_best_tau"></a><span class="summary-sig-name">find_best_tau</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">mu</span>)</span><br />
      returns the value of tau which maximizes normal loglik for a fixed (x,mu)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#find_best_tau">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="trunk.BIP.Bayes.like-module.html#Lognormal" class="summary-sig-name">Lognormal</a>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">mu</span>,
        <span class="summary-sig-arg">tau</span>)</span><br />
      Lognormal Log-likelihood</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Lognormal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Poisson"></a><span class="summary-sig-name">Poisson</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">mu</span>)</span><br />
      Poisson Log-Likelihood function
&gt;&gt;&gt; Poisson([2],2)
-1.30685281944</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Poisson">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Negbin"></a><span class="summary-sig-name">Negbin</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">r</span>,
        <span class="summary-sig-arg">p</span>)</span><br />
      Negative Binomial Log-Likelihood
&gt;&gt;&gt; Negbin([2,3],6,0.3)
-9.16117424315</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Negbin">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Binomial"></a><span class="summary-sig-name">Binomial</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">n</span>,
        <span class="summary-sig-arg">p</span>)</span><br />
      Binomial Log-Likelihood
&gt;&gt;&gt; Binomial([2,3],6,0.3)
-2.81280615454</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Binomial">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Weibull"></a><span class="summary-sig-name">Weibull</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">alpha</span>,
        <span class="summary-sig-arg">beta</span>)</span><br />
      Log-Like Weibull
&gt;&gt;&gt; Weibull([2,1,0.3,.5,1.7],1.5,3)
-7.811955373</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Weibull">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Bernoulli"></a><span class="summary-sig-name">Bernoulli</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">p</span>)</span><br />
      Log-Like Bernoulli
&gt;&gt;&gt; Bernoulli([0,1,1,1,0,0,1,1],0.5)
-5.54517744448</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Bernoulli">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Gamma"></a><span class="summary-sig-name">Gamma</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">alpha</span>,
        <span class="summary-sig-arg">beta</span>)</span><br />
      Log-Like Gamma
&gt;&gt;&gt; Gamma([2,3,7,6,4],2,2)
-11.015748357</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Gamma">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Beta"></a><span class="summary-sig-name">Beta</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">a</span>,
        <span class="summary-sig-arg">b</span>)</span><br />
      Log-Like Beta
&gt;&gt;&gt; Beta([.2,.3,.7,.6,.4],2,5)
-0.434845728904</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Beta">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Simple"></a><span class="summary-sig-name">Simple</span>(<span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">w</span>,
        <span class="summary-sig-arg">a</span>,
        <span class="summary-sig-arg">start</span>=<span class="summary-sig-default">0</span>)</span><br />
      find out what it is.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Simple">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="Categor"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Categor</span>(<span class="sig-arg">x</span>,
        <span class="sig-arg">hist</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Categor">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Categorical Log-likelihood
generalization of a Bernoulli process for variables with any constant
number of discrete values.</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>Categor([1],([.3,.7],[0,1]))
<span class="py-output">-0.356674943939</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>x</code></strong> - : data vector (list)</li>
        <li><strong class="pname"><code>hist</code></strong> - : tuple (prob,classes) classes contain the superior limit of the histogram classes</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="Uniform"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Uniform</span>(<span class="sig-arg">x</span>,
        <span class="sig-arg">min</span>,
        <span class="sig-arg">max</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Uniform">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Uniform Log-likelihood</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>Uniform([1.1,2.3,3.4,4],0,5)
<span class="py-output">-6.4377516497364011</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>x</code></strong> - : data vector(list)</li>
        <li><strong class="pname"><code>min</code></strong> - : lower limit of the distribution</li>
        <li><strong class="pname"><code>max</code></strong> - : upper limit of the distribution</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="Normal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Normal</span>(<span class="sig-arg">x</span>,
        <span class="sig-arg">mu</span>,
        <span class="sig-arg">tau</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Normal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Normal Log-like</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>Normal([0],0,1)
<span class="py-output">-0.918938533205</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>mu</code></strong> - : mean</li>
        <li><strong class="pname"><code>tau</code></strong> - : precision (1/variance)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="Lognormal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Lognormal</span>(<span class="sig-arg">x</span>,
        <span class="sig-arg">mu</span>,
        <span class="sig-arg">tau</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="trunk.BIP.Bayes.like-pysrc.html#Lognormal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Lognormal Log-likelihood</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>Lognormal([0.5,1,1.2],0,0.5)
<span class="py-output">-3.15728720569</span></pre>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>mu</code></strong> - : mean</li>
        <li><strong class="pname"><code>tau</code></strong> - : precision (1/sd)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="trunk.BIP-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bayesian-inference">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Jan 26 15:29:58 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
